/*
 * @Author: zhangyun
 * @Date: 2021-04-26 11:33:41
 * @LastEditors: zhangyun
 * @LastEditTime: 2021-04-26 15:33:39
 * @Desc:
 */
const CODES_TYPE = {
  200: '请求成功',
  301: '请求重定向',
  400: '请求异常',
  404: '接口异常',
  422: '请求异常',
  500: '服务器异常',
}
const message = (code, message, data) => {
  return {
    statusCode: code,
    statusText: CODES_TYPE[code],
    message: message,
    data: data || null,
  }
}
module.exports = message
